<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        let obj = {
            name: 'strive'
        }
        let newObj = new Proxy(obj, {
            get(target, property){
                if(property in target){
                    return target[property]
                }else{
                   console.error(`${property} 不在对象上`)
                   return '^_^'
                }
               
            }
        })
        console.log( newObj.name);
        console.log( newObj.age);
    </script>
</head>

<body>
    
</body>
</html>